//package com.li.controller;
//
//import com.li.DTO.Content;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.log4j.Log4j2;
//import org.jsoup.Jsoup;
//import org.jsoup.nodes.Document;
//import org.jsoup.nodes.Element;
//import org.jsoup.select.Elements;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.LinkedList;
//import java.util.List;
//
///**
// * 爬取Github
// * **/
//
//@Log4j2
//@RequestMapping(path = "/reptile")
//@RestController
//@Api(tags = "爬虫")
//public class ReptileGitRepositories {
//
//    @ApiOperation(value = "爬取GitHub")
//    @PostMapping("/github")
//    public List<Content> parseJD(String keyWords) throws  Exception{
//        String url = "https://github.com/search?l=Java&q=%E7%88%AC%E8%99%AB&type=Repositories";
//        Document document = Jsoup.connect(url).userAgent("Mozilla/5.0 (Windows NT 5.1; zh-CN) AppleWebKit/535.12 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/535.12").timeout(30000).get();
//        Element element = document.getElementById("v-align-middle");
////        Elements li = element.getElementsByTag("li");
////        LinkedList<Content> goodsList = new LinkedList<>();
////        for (Element el : li) {
////            String img = el.getElementsByTag("img").eq(0).attr("data-lazy-img");
////            String price = el.getElementsByClass("p-price").eq(0).text();
////            String title = el.getElementsByClass("p-name").eq(0).text();
////            Content content = new Content().setImg(img).setPrice(price).setTitle(title);
////            goodsList.add(content);
////        }
//        return null;
//    }
//}
